<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
	<head>
 <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/CSS/bootstrap.css" />
		<link href="${pageContext.request.contextPath}/CSS/base.css" rel="stylesheet">
		<link href="${pageContext.request.contextPath}/CSS/animate.min.css" rel="stylesheet">
    <title>图片分享社区 - 首页</title>
  </head>

  <body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container" >
        <div class="navbar-header">
          <a class="navbar-brand" href="fonthead.action">
						<span class="nav-title">图片分享社区</span>
					</a>
        </div>

        <div id="navbar" class="navbar-collapse collapse" >
          <div class="navbar-form navbar-right">
						<li class="dropdown" >
			        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
								<s:if test="#session.IMG==null">
								<img class="img-circle" style="height: 40px;" src="${pageContext.request.contextPath}/IMG/headimg.jpg">
							</s:if>
							<s:else>
							<img class="img-circle" style="height: 40px;" src='<s:property value="#session.IMG"/>'>
							</s:else>
							</a>						
						<s:if test="#session.ID==null">
			        <ul class="dropdown-menu">
			         <li><a href="loginfont.action">登陆</a></li>
			           <li role="separator" class="divider"></li>
			           <li><a href="registerpage.action">注册</a></li>
			     
			    
			        </ul>
			        </s:if>
			        <s:else>
			         <ul class="dropdown-menu">

			          <li><a href="userprofile.action?id=<s:property value="#session.ID"/>">个人主页</a></li>
			          <li role="separator" class="divider"></li>
			              <li><a href="alelterpassword.action">修改密码</a></li>
			           <li role="separator" class="divider"></li>
			          <li><a href="logoutfont.action">注销</a></li>
			        </ul>
			        </s:else>
			      </li>
          </div>
        </div>
      </div>
    </nav>
<div class="container main-body" style="margin-top:10%;">
      <div class="row">
        <div class="col-md-2 profile animated slideInLeft">
          <div>
            <img class="img-circle" style="height: 100px;" src='<s:property value="user.headimg"/>'>
          </div>
          <div>
     
            <h2><s:property value="user.username"/></h2>       
          </div>        
        </div>
         <div class="col-md-8">
         <div class="row">
         <div class="col-md-3"></div>
         <div class="col-md-8">
         <form class="form-horizontal" action="alelterpasswordresult.action?id=<s:property value="user.id"/>" onsubmit="return check()" method="post">
  <div class="form-group">
    <label class="col-sm-4 control-label">用户名</label>
    <div class="col-sm-6">
      <p class="form-control-static"><s:property value="user.username"/></p>
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-4 control-label">注册时间</label>
    <div class="col-sm-6">
      <p class="form-control-static"><s:property value="user.registertime"/></p>
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword" class="col-sm-4 control-label">密码</label>
    <div class="col-sm-6">
      <input type="password" class="form-control" id="inputPassword" placeholder="密码">
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword" class="col-sm-4 control-label">确认密码</label>
    <div class="col-sm-6">
      <input type="password" class="form-control" id="comfirmPassword" placeholder="确认密码">
    </div>
  </div>
  <input type="hidden" name="password" id="field＿name" value="value"/>
  <div class="form-group">
  <div class="col-sm-4"></div>
  <div class="col-sm-7">
   <button type="submit" class="btn btn-primary">修改</button>
   <a type="button" class="btn btn-default" href="userprofile.action?id=<s:property value="user.id"/>">取消</a>
  </div>
  </div>
</form>
</div>
</div>
         </div>
        </div>
        </div>
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel" style="text-align:center;">操作提示</h4>
      </div>
      <div class="modal-body">
                     <h5 style="text-align:center;">请填写完整表单！！</h5>
      </div>
      <div class="modal-footer">
    
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>
<div class="modal fade" id="my" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel" style="text-align:center;">操作提示</h4>
      </div>
      <div class="modal-body">
                     <h5 style="text-align:center;">密码与确认密码不相同</h5>
      </div>
      <div class="modal-footer">
    
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>
		<!--footer-->
<footer>
    <div class="container" style="text-align:center">
        <div class="row">
            <div class="col-md-12">
                <p>
                    Copyright&nbsp;©&nbsp;2012-2015&nbsp;&nbsp;www.sharephoto.com&nbsp;&nbsp;粤ICP备13014270号-4
                </p>
            </div>
        </div>
    </div>
</footer>
<!--footer-->
		<script src="${pageContext.request.contextPath}/JS/jquery-1.12.3.min.js"></script>
<script src="${pageContext.request.contextPath}/JS/bootstrap.min.js"></script>
<script type="text/javascript">
 $(function(){
        $('#inputPassword').focus();
    });
    function check(){
   if($("#inputPassword").val().trim()=="" ||$("#comfirmPassword").val().trem==""){
   $("#myModal").modal("show");
   return false;
   }else{
   if($("#inputPassword").val().trim()!==$("#comfirmPassword").val().trim()){
     $("#my").modal("show");
  return false; 
  }
  else{
  $("#field＿name").val($("#inputPassword").val().trim());
  return true;
  }
   }
  };
</script>
  </body>
</html>

